home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / prim / inc-vers.el.z / inc-vers.el
Encoding:
Text File  |  1998-05-21  |  1.8 KB  |  57 lines

  1. ;;; inc-vers.el --- load this to increment the recorded XEmacs version number.
  2.  
  3. ;; Copyright (C) 1985, 1986, 1993 Free Software Foundation, Inc.
  4.  
  5. ;; Maintainer: FSF
  6. ;; Keywords: internal
  7.  
  8. ;; This file is part of XEmacs.
  9.  
  10. ;; XEmacs is free software; you can redistribute it and/or modify it
  11. ;; under the terms of the GNU General Public License as published by
  12. ;; the Free Software Foundation; either version 2, or (at your option)
  13. ;; any later version.
  14.  
  15. ;; XEmacs is distributed in the hope that it will be useful, but
  16. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18. ;; General Public License for more details.
  19.  
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with XEmacs; see the file COPYING.  If not, write to the 
  22. ;; Free Software Foundation, 59 Temple Place - Suite 330,
  23. ;; Boston, MA 02111-1307, USA.
  24.  
  25. ;;; Synched up with: Not in FSF.
  26.  
  27. ;;; Code:
  28.  
  29. (insert-file-contents "../lisp/version.el")
  30.  
  31. (re-search-forward 
  32.   "emacs-version \"[^\"0-9]*[0-9]+\\.[0-9]+\\(\\.\\([0-9]+\\)\\|\\)\\( (.*)\\)?\"")
  33. (let ((version (if (= (match-beginning 1) (match-end 1))
  34.            (forward-char -1)
  35.          (goto-char (match-beginning 2))
  36.          (read (current-buffer)))))
  37.   (if (null version)
  38.       (insert ".1")
  39.     (delete-region (match-beginning 2) (match-end 2))
  40.     (prin1 (1+ version) (current-buffer))))
  41. (skip-chars-backward "^\"")
  42. (message "New XEmacs version will be %s"
  43.      (buffer-substring (point)
  44.                (progn (skip-chars-forward "^\"") (point))))
  45.  
  46.  
  47. (if (and (file-accessible-directory-p "../lisp/")
  48.      (null (file-writable-p "../lisp/version.el")))
  49.     (delete-file "../lisp/version.el"))
  50. (write-region (point-min) (point-max) "../lisp/version.el" nil 'nomsg)
  51. (erase-buffer)
  52. (set-buffer-modified-p nil)
  53.  
  54. (kill-emacs)
  55.  
  56. ;;; inc-vers.el ends here
  57.